import request from '@/router/axios';

// 分类
export const categoriesList = (data) => {
  return request({
    url: '/api/xmbz-goods/goods/categories',
    method: 'get',
    data
  })
}

export const shopList = (query) => {
  return request({
    url: '/api/xmbz-goods/goods/getQueryGoodsPage',
    // url:'http://192.168.2.11:8105/goods/getQueryGoodsPage',
    method: 'get',
    params: query
  })
}

// 城市接口
export const citySelect = (query) => {
  return request({
    // url: 'http://dev.crm.xiongmaodangao.com/dept/depts',
    url: '/api/xmbz-system/dept/depts',
    method: 'get',
    params: query
  })
}

// // 城市接口
// export const citySelect = (query) => {
//   return request({
//     url: '/api/xmbz-dept/dept/depts',
//     method: 'get',
//     params: query
//   })
// }

// 创建订单
export const createOrder = (data) => {
  return request({
    // url: 'http://192.168.2.11:8107/order/createOrder',
    url:'/api/xmbz-order/order/createOrder',
    method: 'post',
    data
  })
}

// 备款商品分页列表
export const getProvisionsGoodsPage = (query) => {
  return request({
    // url: 'http://192.168.2.11:8107/order/getProvisionsGoodsPage',
    url:'/api/xmbz-order/order/getProvisionsGoodsPage',
    method: 'get',
    params: query
  })
}

// 创建订单添加备款商品后，判断是否更新原订单状态
export const createOrderByProvisions = (data) => {
  return request({
    // url: 'http://192.168.2.11:8107/order/createOrderByProvisions',
    url:'/api/xmbz-order/order/createOrderByProvisions',
    method: 'post',
    data
  })
}


// 总仓列表接口
export const getMainWarehouseList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getMainWarehouseList',
    method: 'get',
    params: query
  })
}

// 总仓列表接口（根据系统管理角色来设置的）
export const getMainWarehouseListByRoleId = (query) => {
  return request({
    url: '/api/xmbz-order/order/getMainWarehouseListByRoleId',
    method: 'get',
    params: query
  })
}
// 总仓列表接口（根据系统管理角色来设置的）全部
export const getMainWarehouseListByRoleIdAll = (query) => {
  return request({
   // url: 'http://192.168.2.11:8107/order/getMainWarehouseListByRoleIdAll',
    url: '/api/xmbz-order/order/getMainWarehouseListByRoleIdAll',
    method: 'get',
    params: query
  })
}
export const getSeparateWarehouseListByRoleIdAll= (query) => {
  return request({
      // url: 'http://192.168.2.11:8107/order/getSeparateWarehouseListByRoleIdAll',
    url: '/api/xmbz-order/order/getSeparateWarehouseListByRoleIdAll',
    method: 'get',
    params: query
  })
}

// 分仓列表接口
export const getSeparateWarehouseList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getSeparateWarehouseList',
    method: 'get',
    params: query
  })
}
// 分仓列表接口（根据系统管理角色来设置的）
export const getSeparateWarehouseListByRoleId = (query) => {
  return request({
    url: '/api/xmbz-order/order/getSeparateWarehouseListByRoleId',
    method: 'get',
    params: query
  })
}


// 渠道类别列表
export const getOrderChannelTypeList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderChannelTypeList',
    // url: 'http://192.168.2.11:8107/order/getOrderChannelTypeList',
    method: 'get',
    params: query
  })
}

// 渠道列表接口
export const getOrderChannelList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderChannelList',
    // url: 'http://192.168.2.11:8107/order/getOrderChannelList',
    method: 'get',
    params: query
  })
}

// 渠道列表接口
export const getChannelList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getChannelList',
    // url: 'http://192.168.2.11:8107/order/getChannelList',
    method: 'get',
    params: query
  })
}

// 根据经度纬度，返回分仓总仓名称
export const getWarehouseName = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/get',
    // url:'http://192.168.2.11:8107/warehouse/get',
    method: 'get',
    params: query
  })
}

// 仓库剩余负荷列表
export const getSurplusWarehouseLoadList = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getSurplusWarehouseLoadList',
    // url:'http://192.168.2.11:8107/warehouse/getSurplusWarehouseLoadList',
    method: 'GET',
    params: query
  })
}

// 判断当前商品是否关闭
export const judgeGoodsClose = (query) => {
  return request({
    url: '/api/xmbz-goods/goods/judgeGoodsClose',
    // url:'http://192.168.2.11:8105/goods/judgeGoodsClose',
    method: 'GET',
    params: query
  })
}

export const getCloseAndDeliveryList = (query) =>{
  return request({
    url: '/api/xmbz-order/order/getCloseAndDeliveryList',
    method: 'GET',
    params: query
  })
}

// 订单修改通知
export const getNoticePage = (params) =>{
  return request({
    url: '/api/xmbz-order/order/listblessing',
    method:'get',
    params
  })
}

// 订单修改通知
export const updateBlessingNotice = (data) =>{
  return request({
    url: '/api/xmbz-order/order/updateblessingnotice',
    method:'post',
    data
  })
}
